//
//  UILabel=x.m
//  AFNetworking
//
//  Created by baboy on 2019/2/16.
//

#import <Foundation/Foundation.h>

UILabel * createLabel(CGRect frame,UIFont *font,UIColor *bg,UIColor *textColor,UIColor *shadow,CGSize shadowSize,int textAlign,int numOfLines,int lineBreakMode){
    frame.origin.x = ceilf(frame.origin.x);
    frame.origin.y = ceilf(frame.origin.y);
    frame.size.width = ceilf(frame.size.width);
    frame.size.height = ceilf(frame.size.height);
    UILabel *label = [[UILabel alloc] initWithFrame:frame];
    label.font = font;
    label.backgroundColor = bg?bg:[UIColor clearColor];
    label.textColor = textColor;
    if (shadow) {
        label.shadowColor = shadow;
        label.shadowOffset = shadowSize;
    }
    label.numberOfLines = numOfLines;
    label.lineBreakMode = lineBreakMode;
    label.textAlignment = textAlign;
    return label;
}

@implementation UILabel(x)
- (void)setLocalizedKey:(NSString *)localizedKey{
    self.text = NSLocalizedString(localizedKey, @"UILabel");
}
- (NSString*)localizedKey{
    return nil;
}
@end
